import 'package:flutter/material.dart';

///
/// ListView API :  https://api.flutter-io.cn/flutter/widgets/ListView-class.html
///
///
class DemoListView3Dynamic extends StatelessWidget {
  final List<String> items;
  const DemoListView3Dynamic({Key? key, required this.items}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'JSPang Flutter ListView Demo',
      home: Scaffold(
        appBar: AppBar(
          title: const Text('ListView widget'),
        ),
        body: ListView.builder(
            itemCount: items.length,
            itemBuilder: (context, index) {
              return ListTile(
                title: Text(items[index]),
              );
            },
        ),
      ),
    );
  }
}
